package com.gudong.model.except;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class ApplicationException extends RuntimeException {


    /**
     * 错误码
     */
    private Integer code;

    /**
     * 错误提示
     */
    private String message;


    public ApplicationException(Throwable cause) {
        super(cause.getMessage(), cause);
    }

    public ApplicationException(String message) {
        this.message = message;
    }

    public ApplicationException(String message, Integer code) {
        this.message = message;
        this.code = code;
    }
}
